/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.openbrew.openbrewrf;

import com.openbrew.openbrewrf.views.YeastGensView;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "Brinks")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Brinks.findAll", query = "SELECT b FROM Brinks b"),
    @NamedQuery(name = "Brinks.findByBrinkID", query = "SELECT b FROM Brinks b WHERE b.brinkID = :brinkID"),
    @NamedQuery(name = "Brinks.findByBrinkVolume", query = "SELECT b FROM Brinks b WHERE b.brinkVolume = :brinkVolume"),
    @NamedQuery(name = "Brinks.findByBrinkDescription", query = "SELECT b FROM Brinks b WHERE b.brinkDescription = :brinkDescription"),
    @NamedQuery(name = "Brinks.findByBrinkNotes", query = "SELECT b FROM Brinks b WHERE b.brinkNotes = :brinkNotes"),
    @NamedQuery(name = "Brinks.findByBrinkWeight", query = "SELECT b FROM Brinks b WHERE b.brinkWeight = :brinkWeight")})
public class Brinks implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "BrinkID")
    private Integer brinkID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BrinkVolume")
    private float brinkVolume;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 100)
    @Column(name = "BrinkDescription")
    private String brinkDescription;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 250)
    @Column(name = "BrinkNotes")
    private String brinkNotes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BrinkWeight")
    private float brinkWeight;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "yGBrinkID")
    private Collection<YeastGens> ygCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "yGBrinkID")
    private Collection<YeastGensView> ygViewCollection;

    public Brinks() {
    }

    public Brinks(Integer brinkID) {
        this.brinkID = brinkID;
    }

    public Brinks(Integer brinkID, float brinkVolume, String brinkDescription, String brinkNotes, float brinkWeight) {
        this.brinkID = brinkID;
        this.brinkVolume = brinkVolume;
        this.brinkDescription = brinkDescription;
        this.brinkNotes = brinkNotes;
        this.brinkWeight = brinkWeight;
    }

    public Integer getBrinkID() {
        return brinkID;
    }

    public void setBrinkID(Integer brinkID) {
        this.brinkID = brinkID;
    }

    public float getBrinkVolume() {
        return brinkVolume;
    }

    public void setBrinkVolume(float brinkVolume) {
        this.brinkVolume = brinkVolume;
    }

    public String getBrinkDescription() {
        return brinkDescription;
    }

    public void setBrinkDescription(String brinkDescription) {
        this.brinkDescription = brinkDescription;
    }

    public String getBrinkNotes() {
        return brinkNotes;
    }

    public void setBrinkNotes(String brinkNotes) {
        this.brinkNotes = brinkNotes;
    }

    public float getBrinkWeight() {
        return brinkWeight;
    }

    public void setBrinkWeight(float brinkWeight) {
        this.brinkWeight = brinkWeight;
    }

    @XmlTransient
    public Collection<YeastGens> getYGCollection() {
        return ygCollection;
    }

    public void setYGCollection(Collection<YeastGens> ygCollection) {
        this.ygCollection = ygCollection;
    }

    @XmlTransient
    public Collection<YeastGensView> getYgViewCollection() {
        return ygViewCollection;
    }

    public void setYgViewCollection(Collection<YeastGensView> ygViewCollection) {
        this.ygViewCollection = ygViewCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (brinkID != null ? brinkID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Brinks)) {
            return false;
        }
        Brinks other = (Brinks) object;
        if ((this.brinkID == null && other.brinkID != null) || (this.brinkID != null && !this.brinkID.equals(other.brinkID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.Brinks[ brinkID=" + brinkID + " ]";
    }
    
}
